# $(call make-depend,source-file,object-file,depend-file)
define make-depend
$(GXX) -MM -MF $3 -MP -MT $2 $(CXXFLAGS) $1
endef

%.o: %.cc $(GENH) $(SUBDIR)../config.mk
	$(call make-depend,$<,$@,$(subst .o,.d,$@))
	$(CXX) $(CXXFLAGS) -c $<

%.pb.cc %.pb.h: %.proto
	$(PROTOC) $< --cpp_out .

ifneq "$(MAKECMDGOALS)" "clean"
-include $(DEP)
endif
